/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.elka.gis.main;

/**
 *
 * @author looser
 */
public class PositionCounter {

    public static Float countXPos( Integer translatedX, PaintingHints hints){
        Float xRange = (float) hints.getxRange().intValue();
        Float positionXScale = hints.getMapW()/xRange;
        Integer xTrans = -hints.getMinX();

        return (translatedX + xTrans)*positionXScale;
    }

    public static Float countYPos( Integer translatedY, PaintingHints hints){
        Float yRange = (float) hints.getyRange().intValue();
        Float positionYScale = hints.getMapH()/yRange;
        Integer yTrans = -hints.getMinY();

        return hints.getMapH()- (translatedY + yTrans)*positionYScale;
    }
}
